//Hard to Kill - 0 Rings (Code to survive upon being damaged with 0 rings and no shield at the cost of 25% energy)
/*addHook("PlayerThink", function(player) --Defining the "death defiance" variable that will be used to delay energy regeneration after a Hard To Kill passive takes effect and setting up how it depletes
	if player.mo and player.mo.valid then
	
		if player.mo.skin ~= "annie_belnades" then
			return
		end
		
		if player.mo.deathdefiance == nil then
			player.mo.deathdefiance = 0
		end
		
		if player.mo.deathdefiance > 0
		and player.powers[pw_flashing] == 0 --Death Defiance doesn't run down during mercy invulnerability
//		and player.panim ~= PA_KNOCKDOWN or PA_WALLPLASTERED then
		and player.mo.squished == 0
		and player.mo.drowndelay == 0
		and player.mo.suffocatedelay == 0 then
			if not (leveltime%TICRATE) then
				player.mo.deathdefiance = $ - 1 --Wait 3 seconds after survival (or 1 second after avoiding drowning/suffocation) to resume usual energy replenishment routine
			end
		end
	end
end)*/

/*Pseudocode
addHook("ShouldDamage", function(target, inflictor, source, damage, damagetype) --Target = player.mo (Annie), inflictor & source = any, damage = any, damagetype = any non-instakill that reduces health to 0 (Annie takes ordinary damage with no Rings and no shield)
	if target.player and target.player.valid then
	
		if target.player.mo.skin ~= "annie_belnades" then
			return
		end
		
		if target.player.mo.energy >= 25*FRACUNIT
		and target.player.rings == 0 and target.player.powers[pw_shield] == 0 then
			intercept standard Ring/shield-removing damage, replace PST_DEAD with PA_PAIN --player does not die, but the damage still counts against them for the purpose of variables tracking how often they have been hit
			player.mo.energy = $ - 25*FRACUNIT --ability cost (reduce energy by 25)
			player.mo.deathdefiance = 3 --Stop automatic energy regeneration during post-hit invulnerability and for 3 seconds afterwards --to make this into more of an insurance policy against mistakes rather than a license to be reckless
		end
	end
end, MT_PLAYER)*/